<template>
  <div id="app">
        <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>
  import back from '@/components/back'
export default {
  provide(){
    return{
      reload:this.reload
    }
  },
  data(){
    return{
      isRouterAlive:true
    }
  },
  methods:{
    reload(){
      this.isRouterAlive = false
      this.$nextTick(function () {
        this.isRouterAlive = true
      })
    }
  },
  created(){

    if(localStorage.getItem('userId') === null){
      localStorage.setItem('userId','');
    }
    this.$store.state.merchantId = localStorage.getItem('userId');
  //   if(sessionStorage.getItem('session_token') === null){
  //     sessionStorage.setItem('session_token','')
  //   }
  //   this.$store.state.session_token = sessionStorage.getItem('session_token')
  //
  //   if(sessionStorage.getItem('openId') === null){
  //     sessionStorage.setItem('openId','')
  //   }
  //   this.$store.state.openId = sessionStorage.getItem('openId')
   },
  components:{
    back,
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
}
</style>
